package com.xdf.docmanagementsystem.controller;

import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.xdf.docmanagementsystem.entity.ResponseResult;
import java.util.List;
import com.xdf.docmanagementsystem.entity.DocumentDailyRecord;
import com.xdf.docmanagementsystem.service.DocumentDailyRecordService;

/**
* @Description : 自动生成的控制层
* @Author : ZK
* @Date : 2020-06-29 08:27:36
*/
@Api(tags = "文档档案日志")
@CrossOrigin
@RestController
@RequestMapping("/documentDailyRecord")
public class DocumentDailyRecordController {

@Autowired
private DocumentDailyRecordService service;

/**
* @Description : 选择新增
*
* @Return : ResponseResult<Void>
* @Author : ZK
* @Date : 2020-06-29 08:27:36
*/
@ApiOperation(value = "选择新增",httpMethod = "POST",notes = "自动生成的新增方法")
@RequestMapping(value = "/insertSelective",method = RequestMethod.POST)
public ResponseResult<Void> insertSelective(DocumentDailyRecord record) throws Exception{
        service.insertSelective(record);
        return new ResponseResult<Void>();
}

/**
* @Description : 批量新增
*
* @Return : ResponseResult<Void>
* @Author : ZK
* @Date : 2020-06-29 08:27:36
*/
@ApiOperation(value = "批量新增",httpMethod = "POST",notes = "自动生成的新增方法")
@RequestMapping(value = "/multiInsert",method = RequestMethod.POST)
public ResponseResult<Void> multiInsert(@RequestBody List<DocumentDailyRecord> list) throws Exception{
        service.multiInsert(list);
        return new ResponseResult<Void>();
}

/**
* @Description : 选择修改
*
* @Return : DocumentDailyRecord
* @Author : ZK
* @Date : 2020-06-29 08:27:36
*/
@ApiOperation(value = "选择修改",httpMethod = "PUT",notes = "自动生成的修改方法")
@RequestMapping(value = "/updateSelective",method = RequestMethod.POST)
public ResponseResult<Void> updateSelective(DocumentDailyRecord record) throws Exception{
               service.updateByPrimaryKeySelective(record);
               return new ResponseResult<Void>();
}

/**
* @Description : 批量修改
*
* @Return : DocumentDailyRecord
* @Author : ZK
* @Date : 2020-06-29 08:27:36
*/
@ApiOperation(value = "批量修改",httpMethod = "POST",notes = "自动生成的修改方法")
@RequestMapping(value = "/multiUpdate",method = RequestMethod.POST)
public ResponseResult<Void> multiUpdate(@RequestBody List<DocumentDailyRecord> list) throws Exception{
                    service.multiUpdate(list);
                    return new ResponseResult<Void>();
}

/**
* @Description : 根据主键查询
*
* @Return : DocumentDailyRecord
* @Author : ZK
* @Date : 2020-06-29 08:27:36
*/
@ApiOperation(value = "根据主键查询",httpMethod = "GET",notes = "自动生成的查询方法")
@RequestMapping(value = "/queryByPk/{id}",method = RequestMethod.GET)
public DocumentDailyRecord selectByPrimaryKey(@PathVariable("id")Integer id) throws Exception{
                        if(id == null) return null;
                        return service.selectByPrimaryKey(id);
}

/**
* @Description : 查询方法
*
* @Return : java.util.List
* @Author : ZK
* @Date : 2020-06-29 08:27:36
*/
@ApiOperation(value = "查询方法",httpMethod = "GET",notes = "自动生成的查询方法")
@RequestMapping(value = "/listQuery",method = RequestMethod.GET)
public List<DocumentDailyRecord> query(DocumentDailyRecord record) throws Exception{
        return service.listQuery(record);
}

/**
* @Description : 根据主键删除方法
*
* @Return : ResponseResult<Void>
* @Author : ZK
* @Date : 2020-06-29 08:27:36
*/
@ApiOperation(value = "根据主键删除方法",httpMethod = "DELETE",notes = "自动生成的删除方法")
@RequestMapping(value = "/deleteByPk/{id}",method = RequestMethod.POST)
public ResponseResult<Void> deleteByPrimaryKey(@PathVariable("id")Integer id) throws Exception{
        service.deleteByPrimaryKey(id);
        return new ResponseResult<Void>();
}
}